package Demo2;

import Demo4.IRuning;
import Demo4.ISwimming;

/*
 *Description:
 *User:laoHu
 *Created with Intellij IDEA 2025
 *Data:2025.05.00
 *Time:00:00
 */
public class Dog extends Animal implements ISwimming, IRuning {

    //继承父类后，需要帮助父类的构造方法初始化
    public Dog(String name, int age) {
        super(name, age);
    }

    @Override
    public void eat(){
        System.out.println(this.name + "在吃狗粮....");
    }
    @Override
    public void run() {
        System.out.println(this.name + "在奔跑中....");
    }

    @Override
    public void swim() {
        System.out.println(this.name + "在池塘里用狗刨的方式游泳....");
    }
}
